Property Expressions - Length
Overview
It returns the length of a specified Property or value
Syntax
Length(value)
- value: The Property or value that the length is needed for
- can use arithmatic in this field
Usage:
- Move a file while changing the file extension but keeping the rest of the File Name same
- Combine Length Expression, Arithmetic Expression, and SubString to automatically keep the full Name but change extension
- An Expression followed by
.<extention>
will change the extension of the file while keeping the original base name
Example
- To remove the extention off the file name, we would capture the file name in a property,
[[SI.FILENAME]]
= Test.txt
- Use the Length expression to find the total legnth of the file name.
[[=Length([[SI.FILENAME]])]]
= 8
- Use subtration to remove the length of the extention of the file name from the full length
[[=(Length([[SI.FILENAME]])-4)]]
= 4
- All steps can be combined into one expression
[[=SubStr([[SI.FILENAME]],0,Length([[SI.FILENAME]])-4)]]
= Test
note
Most SMA File Monitors, ie. File Arrival and SMA Resource Monitor, have ways to pass the Root of a File Name while dropping the extension.